diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-10-19 10:50:45 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-10-19 10:50:45 +0200 |
commit | 18dda2927561f32f9f4535a685bff71dd0e6c6dc (patch) | |
tree | 4fdab3b3d41a9ac35e44b1b9563e126c6e05a262 | |
parent | 74d3cd5dd3aabbb789d7ef3b1b6b0c172373f370 (diff) | |
download | Chimère - projet Saclay-18dda2927561f32f9f4535a685bff71dd0e6c6dc.tar.bz2 Chimère - projet Saclay-18dda2927561f32f9f4535a685bff71dd0e6c6dc.zip |
Force refresh of static files with version number
-rw-r--r-- | templates/chimere/base.html | 28 | ||||
-rw-r--r-- | templates/chimere/main_map.html | 8 | ||||
-rw-r--r-- | version.py | 8 | ||||
-rw-r--r-- | views.py | 4 |
4 files changed, 30 insertions, 18 deletions
diff --git a/templates/chimere/base.html b/templates/chimere/base.html index 3943220..d616765 100644 --- a/templates/chimere/base.html +++ b/templates/chimere/base.html @@ -1,22 +1,22 @@ {% extends "base.html" %} {% load chimere_tags i18n %} {% block extra_head %} -<link rel="stylesheet" href="{{ STATIC_URL }}font-awesome/css/font-awesome.min.css" /> -<link rel="stylesheet" href="{{ STATIC_URL }}bootstrap/bootstrap.min.css" /> -<link rel="shortcut icon" href="{{ STATIC_URL }}saclay/images/favicon.png"/> -<link rel="stylesheet" href="{{ STATIC_URL }}chimere/css/styles.css" /> -<link rel="stylesheet" href="{{ STATIC_URL }}chimere/css/print.css" media='print'/> -<link rel="stylesheet" href="{{ STATIC_URL }}saclay/css/styles.css" /> -{% for css in EXTRA_CSS %}<link rel="stylesheet" href="{{ css }}" />{% endfor %} -<link rel="stylesheet" href="{{ STATIC_URL }}saclay/css/print.css" media='print'/> -<script src="{{ STATIC_URL }}bootstrap/bootstrap.min.js" type="text/javascript"></script> +<link rel="stylesheet" href="{{ STATIC_URL }}font-awesome/css/font-awesome.min.css?ver=4.3.0" /> +<link rel="stylesheet" href="{{ STATIC_URL }}bootstrap/bootstrap.min.css?ver=4.3.0" /> +<link rel="shortcut icon" href="{{ STATIC_URL }}saclay/images/favicon.png?ver={{SACLAY_VERSION}}"/> +<link rel="stylesheet" href="{{ STATIC_URL }}chimere/css/styles.css?ver={{VERSION}}" /> +<link rel="stylesheet" href="{{ STATIC_URL }}chimere/css/print.css?ver={{VERSION}}" media='print'/> +<link rel="stylesheet" href="{{ STATIC_URL }}saclay/css/styles.css?ver={{SACLAY_VERSION}}" /> +{% for css in EXTRA_CSS %}<link rel="stylesheet" href="{{ css }}?ver={{SACLAY_VERSION}}" />{% endfor %} +<link rel="stylesheet" href="{{ STATIC_URL }}saclay/css/print.css?ver={{SACLAY_VERSION}}" media='print'/> +<script src="{{ STATIC_URL }}bootstrap/bootstrap.min.js?ver=3.0.0" type="text/javascript"></script> {% if MOBILE %} -<link rel="stylesheet" href="{{ STATIC_URL }}chimere/css/mobile.css" /> -<link rel="stylesheet" href="{{ STATIC_URL }}saclay/css/mobile.css" /> -<script src="{{ STATIC_URL }}chimere/js/mobile.chimere.js" type="text/javascript"></script> -<script src="{{ STATIC_URL }}saclay/js/mobile.chimere.js" type="text/javascript"></script>{%endif%} +<link rel="stylesheet" href="{{ STATIC_URL }}chimere/css/mobile.css?ver={{VERSION}}" /> +<link rel="stylesheet" href="{{ STATIC_URL }}saclay/css/mobile.css?ver={{SACLAY_VERSION}}" /> +<script src="{{ STATIC_URL }}chimere/js/mobile.chimere.js?ver={{VERSION}}" type="text/javascript"></script> +<script src="{{ STATIC_URL }}saclay/js/mobile.chimere.js?ver={{SACLAY_VERSION}}" type="text/javascript"></script>{%endif%} {% if css_area %} -<link rel="stylesheet" href="{{ css_area }}" />{% endif %} +<link rel="stylesheet" href="{{ css_area }}?ver={{SACLAY_VERSION}}" />{% endif %} {% endblock %} {% block header %} <noscript> diff --git a/templates/chimere/main_map.html b/templates/chimere/main_map.html index d8a1bde..305c0ee 100644 --- a/templates/chimere/main_map.html +++ b/templates/chimere/main_map.html @@ -5,10 +5,10 @@ {% head_chimere %} {% comment %}{% head_jme %}{% endcomment %} {% head_form %} -<script src="{{ STATIC_URL }}saclay/js/jquery.form.js" type="text/javascript"></script> +<script src="{{ STATIC_URL }}saclay/js/jquery.form.js?ver={{SACLAY_VERSION}}" type="text/javascript"></script> {% if has_search %} -<script src="{{ STATIC_URL }}chimere/js/search.js" type="text/javascript"></script> -<script src="{{ STATIC_URL }}chimere/js/search-autocomplete.js" type="text/javascript"></script>{% endif %} +<script src="{{ STATIC_URL }}chimere/js/search.js?ver={{VERSION}}" type="text/javascript"></script> +<script src="{{ STATIC_URL }}chimere/js/search-autocomplete.js?ver={{VERSION}}" type="text/javascript"></script>{% endif %} <script type='text/javascript' language='javascript'> <!-- @@ -18,7 +18,7 @@ var edit_route_url = "{% url 'edit-route' %}"; // --> </script> -<script src="{{ STATIC_URL }}saclay/js/interface.js" type="text/javascript"></script> +<script src="{{ STATIC_URL }}saclay/js/interface.js?ver={{SACLAY_VERSION}}" type="text/javascript"></script> {{ block.super }} {% endblock %} {% block message_edit %}{% endblock %} diff --git a/version.py b/version.py new file mode 100644 index 0000000..25526ea --- /dev/null +++ b/version.py @@ -0,0 +1,8 @@ +from chimere.version import VERSION + +SACLAY_MINOR = 1 +SACLAY_VERSION = list(VERSION) + [SACLAY_MINOR] + + +def get_saclay_version(): + return '.'.join((str(num) for num in SACLAY_VERSION)) @@ -25,6 +25,8 @@ from chimere_saclay.forms import MarkerForm, RouteForm from chimere.actions import actions from chimere.models import Marker, Route, PropertyModel +from chimere.version import get_version +from chimere_saclay.version import get_saclay_version from chimere.views import get_edit_page, index @@ -33,6 +35,8 @@ def index_saclay(request, area_name=None, default_area=None, simple=False): get_response=True) response_dct['news_visible'] = False if request.GET else True response_dct['simple'] = simple + response_dct['VERSION'] = get_version() + response_dct['SACLAY_VERSION'] = get_saclay_version() return render_to_response(tpl, response_dct, context_instance=RequestContext(request)) |